package com.example.demo.service.impl;

import com.example.demo.service.Algorithm;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class Add implements Algorithm {

    @Override
    public BigDecimal algorithm(BigDecimal num1, BigDecimal num2) {
        return this.add(num1, num2);
    }

    @Override
    public boolean matching(String type) {
        return "add".equals(type);
    }

    public BigDecimal add(BigDecimal num1, BigDecimal num2){
        return num1.add(num2);
    }
}